import Vue from "vue";
import VueRouter from "vue-router";
//import Home from "../components/Home"

Vue.use(VueRouter)

const routers = [
    {
        path: '/',
        name: 'login',
        redirect: '/login',
        component: () => import('@/components/Login')
    },{
        path: '/login',
        name: 'login',
        component: () => import('@/components/Login')
    },{

        path: '/home',
        name: 'home',
        //component: 'Home'
        component: () => import('@/components/Home')  // 懒加载
        //component: resolve => require(['@/components/Home'], resolve)  // 异步加载
    }
]

export default new VueRouter({
    routers,
    mode: 'history'
})